package com.gzx.plugin.data.wxjk.sync.dao;

import com.gzx.plugin.data.wxjk.sync.pojo.SssjRepayPlan;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RepayPlanDao {

    @Insert("<script>" +
            "INSERT INTO data_wxjk_sssjRepayPlan(" +
            "    business_id," +
            "    repay_date," +
            "    repay_capital," +
            "    repay_interest," +
            "    repay_compensatory," +
            "    repay_subject," +
            "    create_time," +
            "    update_time" +
            ") VALUES " +
            "<foreach collection='list' item='item' separator=','>" +
            "    (" +
            "        #{item.businessId}," +
            "        #{item.repayDate}," +
            "        #{item.repayCapital}," +
            "        #{item.repayInterest}," +
            "        #{item.repayCompensatory}," +
            "        #{item.repaySubject}," +
            "        NOW()," +
            "        NOW()" +
            "    )" +
            "</foreach>" +
            "</script>")
    void batchSave(@Param("list") List<SssjRepayPlan> list);
}
